import fetch from "node-fetch";
import path from 'path';
import fs from 'fs';
import lodash from 'lodash';

const API = `https://api.zxz.ee/api/bqb/?lx`;

const regular = [
    /^(#|\/)?随机猫猫虫$/,
    /^(#|\/)?随机丸子妹$/,
    /^(#|\/)?随机动漫表情$/,
    /^(#|\/)?随机表情$/,
    /^(#|\/)?随机聊天表情$/,
    /^(#|\/)?随机布布$/,
    /^(#|\/)?随机小八嘎$/,
    /^(#|\/)?随机眼镜$/,
];

export class Example3 extends plugin {
    constructor() {
        super({
            name: '[Jiaozi]随机表情',
            dsc: '随机表情',
            event: 'message',
            priority: -1,
            rule: [
                { reg: regular[0], fnc: '猫猫虫' },
                { reg: regular[1], fnc: '丸子妹' },
                { reg: regular[2], fnc: '动漫表情' },
                { reg: regular[3], fnc: '表情' },
                { reg: regular[4], fnc: '聊天表情' },
                { reg: regular[5], fnc: '布布' },
                { reg: regular[6], fnc: '小八嘎' },
                { reg: regular[7], fnc: '眼镜' },
            ]
        });
    }


    async 丸子妹(e) {

        const 图片 = `${API}=1`;

        const message = [图片 ? segment.image(图片) : "",];
    
        await e.reply(message, /*false,*/ { quote: true });
    }

    async 动漫表情(e) {

        const 图片 = `${API}=2`;

        const message = [图片 ? segment.image(图片) : "",];
    
        await e.reply(message, /*false,*/ { quote: true });
    }

    async 表情(e) {

        const 图片 = `${API}=3`;

        const message = [图片 ? segment.image(图片) : "",];
    
        await e.reply(message, /*false,*/ { quote: true });
    }

    async 聊天表情(e) {

        const 图片 = `${API}=4`;

        const message = [图片 ? segment.image(图片) : "",];
    
        await e.reply(message, /*false,*/ { quote: true });
    }

    async 布布(e) {

        const 图片 = `${API}=5`;

        const message = [图片 ? segment.image(图片) : "",];
    
        await e.reply(message, /*false,*/ { quote: true });
    }

    async 猫猫虫(e) {

        const 图片 = `${API}=6`;

        const message = [图片 ? segment.image(图片) : "",];
    
        await e.reply(message, /*false,*/ { quote: true });
    }
    
    async 小八嘎(e) {

        const 图片 = `${API}=7`;

        const message = [图片 ? segment.image(图片) : "",];
    
        await e.reply(message, /*false,*/ { quote: true });
    }

    async 眼睛(e) {

        const 图片 = `${API}=8`;

        const message = [图片 ? segment.image(图片) : "",];
    
        await e.reply(message, /*false,*/ { quote: true });
    }


}